﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BasicRiskSearch.aspx.cs"
    MasterPageFile="~/CISFPortal_RightMenu.Master" Inherits="Microsoft.InformationSecurity.RiskManagement.ISRMWeb.Risks.BasicRiskSearch" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajxToolkit" %>
<%@ Register Src="../UserControls/SearchFilterControl.ascx" TagName="SearchFilterControl"
    TagPrefix="CustomBasicSearch" %>
<%@ Register Assembly="CISFAjaxExtenders" Namespace="Microsoft.InformationSecurity.CISF.Web.AjaxExtenders"
    TagPrefix="cc2" %>
<%@ Register Src="~/UserControls/RighthandMenuControl.ascx" TagName="RighthandMenu"
    TagPrefix="ucRighthandMenu" %>
<asp:Content ID="contendsearchRisk" ContentPlaceHolderID="ContentPlaceHolder" runat="server">
    <asp:UpdatePanel runat="server" ID="riskFeature">
        <ContentTemplate>
            <div style="position: absolute; left: 33%; top: 40%; padding: 0px; border: 0px; border-style: solid;
                width: 400px; height: 200px">
                <asp:UpdateProgress ID="uprProgress" runat="server" DisplayAfter="200">
                    <ProgressTemplate>
                        <table class="progressBar" width="100%" cellpadding="0" cellspacing="0">
                            <tr>
                                <td align="center" style="width: 30%">
                                    <asp:Image ID="imgUpdateProgress" ImageUrl="~/Images/LineSpinner-blue.gif" runat="server" />&nbsp;
                                </td>
                                <td>
                                    <asp:Label ID="lblWaitMessage" Text="Please wait while processing data..." CssClass="messageWait"
                                        Font-Bold="true" runat="server"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ProgressTemplate>
                </asp:UpdateProgress>
            </div>
            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td>
                        <table cellpadding="5" cellspacing="0" border="0" width="100%">
                            <tr>
                                <td>
                                    <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                        <tr>
                                            <td colspan="2">
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" valign="middle" style="width: 5%">
                                                <img src="../Images/Search-32.png" alt="Search" />
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblSearch" Text="Basic Risk Search" CssClass="headerlabel"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <hr />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Panel ID="pnlSearch" Width="100%" GroupingText="Search" CssClass="headerlabel"
                                        runat="server">
                                        <table cellpadding="5" cellspacing="5" border="0" width="100%">
                                            <tr>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <CustomBasicSearch:SearchFilterControl ID="riskBasicSearchControl" runat="server"
                                                        ButtonText="Search" OnSearchFilterSelected="riskBasicSearchControl_SearchFilterSelected"
                                                        BusinessObjectType="Risk" />
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td valign="top" align="left">
                        <asp:GridView Width="100%" Caption="Search results." CssClass="table" CaptionAlign="left"
                            AllowPaging="True" AllowSorting="true" PageSize="15" EmptyDataText="No risks found in the system."
                            DataKeyNames="RiskID" OnPageIndexChanging="gridRiskList_PageIndexChanging" ToolTip="This table displays all the Risks for the basic search criteria."
                            ID="gridRiskList" runat="server" AutoGenerateColumns="False" OnSorting="gridRiskList_Sorting">
                            <PagerSettings Position="TopAndBottom" PageButtonCount="10" />
                            <PagerStyle HorizontalAlign="Right" />
                            <EmptyDataRowStyle CssClass="emptyDataRowStyle" />
                            <AlternatingRowStyle CssClass="alternate" />
                            <Columns>
                                <asp:TemplateField HeaderText="RiskID" ItemStyle-Width="80px" SortExpression="RiskID">
                                    <ItemTemplate>
                                        <a href="SubmitRisk.aspx?RiskID=<%# Microsoft.Security.Application.AntiXss.UrlEncode(Eval("RiskID").ToString()) %>"
                                            title="Click on the link to View or Edit the Risk.">
                                            <%# Microsoft.Security.Application.AntiXss.HtmlEncode(Eval("RiskID").ToString()) %>
                                        </a>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="left" SortExpression="RiskTitle"
                                    HeaderText="Title">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblTitleSearch" Text='<%# Microsoft.Security.Application.AntiXss.HtmlEncode(Eval("Title").ToString()) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-HorizontalAlign="left" HeaderText="Status" SortExpression="RiskStatus"
                                    ItemStyle-Width="80">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblStatusText" Text='<%# Microsoft.Security.Application.AntiXss.HtmlEncode(Eval("StatusText").ToString()) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="CCRV" ItemStyle-Width="90" SortExpression="RiskCCRV">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblCRV" Text='<%# Microsoft.Security.Application.AntiXss.HtmlEncode(ShowUnKnown(int.Parse(Eval("CurrentCalculatedRiskValue").ToString()))) %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="PCRV" ItemStyle-Width="90" SortExpression="PriorityCRV">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblPCRV" Text='<%# Microsoft.Security.Application.AntiXss.HtmlEncode(ShowUnKnown(Decimal.Parse(Eval("RiskPriortizedCRV").ToString()))) %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="105" HeaderStyle-HorizontalAlign="left" HeaderText="Created Date"
                                    SortExpression="RiskCreatedDate">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblCreatedDateBasicSearch" Text='<%# Eval("CreatedDate") %>'></asp:Label>
                                        <cc2:UTCToLocalExtenderControl ID="utcExlblCreatedDateBasicSearch" runat="server"
                                            TargetControlID="lblCreatedDateBasicSearch" DateTimeFormatString="d" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="150" HeaderStyle-HorizontalAlign="left" HeaderText="Submitted By"
                                    ItemStyle-Wrap="true" SortExpression="RiskSubmittedBy">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblSubmittedBySearch" Text='<%# Microsoft.Security.Application.AntiXss.HtmlEncode(Eval("SubmittedByFullName").ToString()) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                        <asp:ObjectDataSource ID="obdsbasicRiskSearch" runat="server" TypeName="Microsoft.InformationSecurity.RiskManagement.ISRMWeb.Risks.BasicRiskSearch"
                            EnablePaging="True" SelectMethod="GetSearchResult" SelectCountMethod="GetSearchResultCount"
                            OnSelecting="obdsbasicRiskSearch_Selecting" OnSelected="obdsbasicRiskSearch_Selected">
                        </asp:ObjectDataSource>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="riskBasicSearchControl" EventName="SearchFilterSelected" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
